@extends('admin.public.base')
@section('title','添加图片')
@section('my-css')
<link rel="stylesheet" href="{{url('/css/admin/colorpicker.css')}}" />
<link rel="stylesheet" href="{{url('/css/admin/datepicker.css')}}" />
<link rel="stylesheet" href="{{url('/css/admin/uniform.css')}}" />
<link rel="stylesheet" href="{{url('/css/admin/select2.css')}}" />
<link rel="stylesheet" href="{{url('/css/admin/bootstrap-wysihtml5.css')}}" />
@endsection

@section('content')
<div id="content">
<div id="content-header">
  <div id="breadcrumb"> <a href="index.html" title="Go to Home" class="tip-bottom"><i class="icon-home"></i> Home</a> <a href="{{url('/admin/picture')}}" class="tip-bottom">图片列表</a> <a href="#" class="current">添加图片</a> </div>
  <h1>添加图片</h1>
</div>
<div class="container-fluid">
  <hr>
  <div class="row-fluid">
    <div class="span6">
      <div class="widget-box">
        <div class="widget-title"> <span class="icon"> <i class="icon-align-justify"></i> </span>
          <h5>添加图片</h5>
        </div>
        <div class="widget-content nopadding">
          <form id='add_form' action="{{url('/admin/picture/doaddImg')}}" method="post" class="form-horizontal">
          <input type="hidden" name="_token" value="{{csrf_token()}}"/>
           
            <div class="control-group">
              <label class="control-label">图片所属新闻id:</label>
              <div class="controls">
                <input type="text" class="span11" name='news_id' placeholder="请输入新闻id" />
              </div>
            </div>
            <!-- <div class="control-group">
              <label class="control-label">图片路径:</label>
              <div class="controls">
                <input type="text" class="span11" name='phone' placeholder="图片路径" />
              </div>
            </div> -->
           
            <div class="control-group">
              <label class="control-label">启用/禁用</label>
              <div class="controls">
                <input type="text" class="span11" name='state' placeholder="默认为1-启用" />
              </div>
            </div>
            <div class="control-group">
              <label class="control-label">上传图片</label>
              <div class="controls">
                <input type="file" name="file"/>
              </div>
            </div>
            <div class="form-actions">
              <button type="button" class="btn btn-success">确认添加</button>
            </div>
          </form>
        </div>
      </div>
    </div>
  </div>
</div>
</div>
@endsection

@section('my-js')
<script src="{{url('/js/bootstrap-colorpicker.js')}}"></script> 
<script src="{{url('/js/bootstrap-datepicker.js')}}"></script> 
<script src="{{url('/js/jquery.toggle.buttons.html')}}"></script> 
<script src="{{url('/js/masked.js')}}"></script> 
<script src="{{url('/js/select2.min.js')}}"></script> 
<script src="{{url('/js/matrix.form_common.js')}}"></script> 
<script src="{{url('/js/wysihtml5-0.3.0.js')}}"></script> 
<script src="{{url('/js/bootstrap-wysihtml5.js')}}"></script>
<script>
$(function(){
  $('.btn').click(function(){
      if($('#add_form input[name=news_id]').val() == ''){
          alert('新闻id不能为空');
          return false;
        }
      
      $('#add_form').submit();
  });
});
</script>
@endsection



